package com.kaifamiao.time;

import java.time.LocalTime;
import java.time.temporal.ChronoUnit;

public class LocalTimeMethods {

    public static void main(String[] args) {

        LocalTime current = LocalTime.now();

        int hour = current.getHour();
        System.out.println( hour );

        int minute = current.getMinute();
        System.out.println( minute );

        int seconds = current.getSecond();
        System.out.println( seconds );

        int nano = current.getNano();
        System.out.println( nano );

        System.out.println( "- - - - - - - - - -");

        LocalTime first = current.plusHours( -5 );
        System.out.println( first );

        LocalTime second = current.plusMinutes( 20 );
        System.out.println( second );

        LocalTime third = current.plus( 1, ChronoUnit.HALF_DAYS );
        System.out.println( third );

    }

}
